@extends('admin.layout.layout')
@section('content')
<div class="row">
    <div class="col-lg-12">
        <h1 class="page-header">分区修改</h1>
    </div>
    <!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="panel-body">
    <div class="row">
        <div class="col-lg-6 col-lg-offset-3">
        @if(session("error"))
            {{session('error')}}
        @endif

        @if (count($errors) > 0)
    
        <div class="alert alert-danger">
        <ul>
            @foreach ($errors->all() as $error)
                <li>{{ $error }}</li>
            @endforeach
        </ul>
        </div>
        @endif
            <form action="{{url('/admin/partition/update')}}" method="post">
                <input type="hidden" name="id" value="{{ $partition->id }}">
                <input type="hidden" name="repartition_name" value="{{ $partition->partition_name }}">
                <input type="hidden" name="reuser_id" value="{{ $partition->user_id }}">
                <div class="form-group">
                    <label>分区名称</label>
                    <input class="form-control" type="text" name="partition_name" value="{{ $partition->partition_name }}">
                </div>
                <div class="form-group">
                    <label>分区板主</label>
                    <select name="user_id" class="form-control">
                        @foreach($user as $k=>$v)
                        <option value="{{ $v->id }}" @if($v->id == $partition->user_id)
                                                            selected
                                                     @endif
                        >{{ $v->username }}</option>
                        @endforeach
                    </select>
                </div>
                {{csrf_field()}}
                <button type="submit" class="btn btn-primary btn-lg" style="margin-left:0px;width:100px">添加</button>
            </form>
            </div>
        </div>
    </div>
@endsection